# This code is part of the MWP System
# Copyright (c) 2012 Benjamin Lubin (blubin@bu.com) 
# Published under and subject to the GPLv2 license available at http://www.gnu.org/licenses/gpl-2.0.html

'''
Created on Dec 18, 2012
@author: blubin
'''

from frontend.roleApplication import RoleApplication;
from frontend.form import Type;
from unique import UNIQUE;

class QAApplication(RoleApplication):
    """ The QA User Interface """

    def __init__(self):
        super(QAApplication, self).__init__("CharacterCreation"+UNIQUE, "QA");
        self.register_sink_step("Test", self.evaluate_character, name_fields=["Name"]);
        self.register_sink_step("Finalize", self.finalize_character, name_fields=["Name"]);
       
    def evaluate_character(self, stepname, form):
        form.add_task_label(fields=["Name", "Description"]);
        form.add_field(Type.BOOLEAN, "TestPassed", labeltext="Is Character Approved?");
        
    def finalize_character(self, stepname, form):
        form.add_task_label(fields=["Finalize"])

if __name__ == '__main__':
    app = QAApplication();
    app.MainLoop();